#ifndef __AVM_SDK_H__
#define __AVM_SDK_H__

#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector>

#ifdef __cplusplus
extern "C"
{
#endif

	enum emA2DType
	{
		A2D_RunningStatus = 0,				 // AVM的运行状态/心跳包
		A2D_WorkMode,						 // AVM的工作模式
		A2D_SoftwareVersion,				 // AVM软件版本
		A2D_DirLampOpenSvm,					 //转向灯触发全景开关状态
		A2D_RadarOpenSvm,					 //雷达触发全景开关状态
		A2D_DispStatus,						 // AVM的显示状态
		A2D_EnterCalibrationResp,			 //进入下线标定响应
		A2D_EnterCalibrationResultResp,		 //请求进入下线标定结果响应
		A2D_CalibrationPreCheckResp,		 //标定预检查响应
		A2D_CalibrationPreCheckResultResp,	 //请求标定预检查结果响应
		A2D_StartCalibrationResp,			 //开始标定响应
		A2D_StartCalibrationResultResp,		 //请求开始标定的结果响应
		A2D_EnterCalibrationFailResp,		 //读取标定失败的原因响应
		A2D_EnterCalibrationFailResultResp,	 //请求读取标定失败的原因的结果响应
		A2D_EnterCalibrationCheckResp,		 //进入下线标定检查响应
		A2D_EnterCalibrationCheckResultResp, //请求下线标定检查的结果响应
		A2D_SnapshotStatus,					 //拍照状态
											 // A2D_PCS_SystemType, //系统类型
		A2D_OSRMAngleAdjFuncCfg,			 //后视镜下翻开关
		A2D_CAMERAPOWERSUPPLY,				 //摄像头供电  传入两个参数  参数1 使用emCameraID枚举传入摄像头ID  参数2 0x0000~0xffff 代表掉电时长 单位ms 0xffff 为常断电
		A2D_CAMERA_CALIBRATION_PARAM_FRONT,	 //前摄像头标定参数
		A2D_CAMERA_CALIBRATION_PARAM_REAR,	 //后摄像头标定参数
		A2D_CAMERA_CALIBRATION_PARAM_LEFT,	 //左摄像头标定参数
		A2D_CAMERA_CALIBRATION_PARAM_RIGHT,	 //右摄像头标定参数
		A2D_CAMERASIGNALSTATUS_FRONT,		 //前摄像头信号状态
		A2D_CAMERASIGNALSTATUS_REAR,		 //后摄像头信号状态
		A2D_CAMERASIGNALSTATUS_LEFT,		 //左摄像头信号状态
		A2D_CAMERASIGNALSTATUS_RIGHT,		 //右摄像头信号状态
		A2D_PAS_ButtonPress,

	};

	enum emD2AType
	{
		D2A_EnterCalibrationReq = 0,		//进入下线标定请求
		D2A_EnterCalibrationResultReq,		//进请求进入下线标定结果请求
		D2A_CalibrationPreCheckReq,			//标定预检查请求
		D2A_CalibrationPreCheckResultReq,	//请求标定预检查结果请求
		D2A_StartCalibrationReq,			//开始标定请求
		D2A_StartCalibrationResultReq,		//请求开始标定的结果请求
		D2A_EnterCalibrationFailReq,		//读取标定失败的原因请求
		D2A_EnterCalibrationFailResultReq,	//请求读取标定失败的原因的结果请求
		D2A_EnterCalibrationCheckReq,		//进入下线标定检查请求
		D2A_EnterCalibrationCheckResultReq, //请求下线标定检查的结果请求
		D2A_Snapshot,						//拍照请求
		D2A_DispReq,						//AVM显示请求
	};
	enum emCameraID
	{
		FRONT_CAMERA = 1, //前摄像头
		REAR_CAMERA = 2,  //后摄像头
		LEFT_CAMERA = 4,  //左摄像头
		RIGHT_CAMERA = 8, //右摄像头
	};

	enum emGetType
	{
		D2AGet_HutConfig = 0, //主机配置 9 Bytes
		D2AGet_VehicleConfig, //车辆配置 44 Bytes
	};

	enum emPowerStateType
	{
		POWER_DISPLAY_OFF,
		POWER_LOCAL_MODE,
		POWER_STR,
		POWER_FULL,
	};

	struct stCanData
	{
		int BCS_FLWheelRotatedDirection; //左前轮前进方向
		int BCS_FLWheelSpd;				 //左前轮轮速, value*0.05625km/h
		int BCS_FLWheelSpdEdgesSum;		 //左前轮脉冲
		int BCS_FRWheelRotatedDirection; //右前轮前进方向
		int BCS_FRWheelSpd;				 //右前轮轮速
		int BCS_FRWheelSpdEdgesSum;		 //右前轮车轮脉冲
		int BCS_RLWheelRotatedDirection; //左后轮前进方向
		int BCS_RLWheelSpd;				 //左后轮轮速
		int BCS_RLWheelSpdEdgesSum;		 //左后轮脉冲
		int BCS_RRWheelRotatedDirection; //右后轮前进方向
		int BCS_RRWheelSpd;				 //右后轮轮速
		int BCS_RRWheelSpdEdgesSum;		 //右后轮车轮脉冲
		int BCM_FrontWiperSt;			 //雨刮
		int BCM_HighBeamSt;				 //远光灯开关
		int BCM_LowBeamSt;				 //近光灯开关
		int BCM_FrontFogLampSt;			 //前雾灯
		int BCM_RearFogLampSt;			 //后雾灯
		int BCM_BrakeLightSwitchSt;		 //刹车灯
		int BCM_LeftTurnLampSt;			 //左转向灯状态
		int BCM_RightTurnLampSt;		 //右转向灯状态
		int TCU_GearForDisp;			 //变速箱档位
		int BCM_ReverseSwitchSt;		 //倒挡状态(BCM_VehReverseSt?)
		int BCM_DriverDoorAjarSt;		 //左前车门状态
		int BCM_PsngrDoorAjarSt;		 //右前车门状态
		int BCM_RLDoorAjarSt;			 //左后车门状态
		int BCM_RRDoorAjarSt;			 //右后车门状态
		int BCM_TrunkAjarSt;			 //行李箱门状态
		int PAS_RRMidDistance;			 //RRM雷达距离
		int PAS_RLMidDistance;			 //RLM雷达距离
		int PAS_RRDistance;				 //RR雷达距离
		int PAS_RLDistance;				 //RL雷达距离
		int PAS_RSLSideDistance;		 //RSL雷达距离
		int PAS_RSRSideDistance;		 //RSR雷达距离
		int PAS_FRDistance;				 //FR雷达距离
		int PAS_FLDistance;				 //FL雷达距离
		int PAS_FRMidDistance;			 //FRM雷达距离
		int PAS_FLMidDistance;			 //FLM雷达距离
		int PAS_FSRSideDistance;		 //FSR雷达距离
		int PAS_FSLSideDistance;		 //FSL雷达距离
		int PAS_FRMidSnsErrFlag;		 //FRM雷达错误
		int PAS_FLMidSnsErrFlag;		 //FLM雷达错误
		int PAS_FSRSnsErrFlag;			 //FSR雷达错误
		int PAS_FSLSnsErrFlag;			 //FSL雷达错误
		int PAS_RRMidSnsErrFlag;		 //RRM雷达错误
		int PAS_RLMidSnsErrFlag;		 //RLM雷达错误
		int PAS_RRSnsErrFlag;			 //RR雷达错误
		int PAS_RLSnsErrFlag;			 //RL雷达错误
		int PAS_RSLSnsErrFlag;			 //RSL雷达错误
		int PAS_RSRSnsErrFlag;			 //RSR雷达错误
		int PAS_FRSnsErrFlag;			 //FR雷达错误
		int PAS_FLSnsErrFlag;			 //RL雷达错误
		int PAS_BattVoltErrFlag;		 //电池状态  PAS_CtrlModulerrFlag || PAS_BattVoltErrFlag
		int PCS_PASButtonPress;			 //雷达报警声开关
		int OSRMAngleAdjFuncCfgSt;		 //后视镜下翻状态
		int FLDCM_MirrorFoldUnfoldSt;	 //左后视镜折叠状态
		int FRDCM_MirrorFoldUnfoldSt;	 //右后视镜折叠状态
		float Vehicle_Speed;			 //车速
		int SRS_VehLongAccel;			 //横向加速度  该信号量的实际范围是-2~2 取到值后请除以1000才是实际值
		int SRS_VehLatrlAccel;			 //纵向加速度  该信号量的实际范围是-2~2 取到值后请除以1000才是实际值
		int SRS_YawRate;				 //横摆角速度  该信号量的实际范围是-180~180 取到值后请除以100才是实际值
		int Vehicle_Language;			 //车机语言
		int Night_Mode;					 //白天黑夜模式
		int SAS_SteeringAngle;			 //方向盘转角方向
		int SAS_SteeringAngleVd;		 //方向盘转角角度
		int BCM_Keyst;
		int BSDS_RCTAWarnLeft;	//L穿行预警
		int BSDM_RCTAWarnRight; //R穿行预警
		int Android_SetupSt;	//安卓启动状态
		int Power_State; //POWER_STR&POWER_LOCAL_MODE关闭AIS_Service，其他可以打开
		int Camera_Connect_Status_Front ;	//前摄像头连接状态
		int Camera_Connect_Status_Rear;		//后摄像头连接状态
		int Camera_Connect_Status_Left;		//左摄像头连接状态
		int Camera_Connect_Status_Right;	//右摄像头连接状态
	};

	typedef void (*AvmSdk_ReceiveDataCB)(int type, const std::vector<int> &val);
	typedef void (*AvmSdk_CanDataCB)(const stCanData &val);
	//初始化接口
	void AvmSdk_Init(AvmSdk_ReceiveDataCB receiveCB, AvmSdk_CanDataCB canDataCB);
	void AvmSdk_SendData(int type, const std::vector<int32_t> &val);
	void AvmSdk_GetData(int type, std::vector<int32_t> &val);

#ifdef __cplusplus
}
#endif

#endif